
 /**
 * QueryTreeMenuAction.java.java.
 * User: BrianChen Date: 2012-7-31 下午04:33:26
 *
 * Copyright (c) 2009 Hewlett-Packard Development Company, L.P.
 * All rights reserved.
 */
package com.collapsar.snail.menu.action;

import java.util.ArrayList;

import com.collapsar.core.action.BaseStrutsAction;
import com.collapsar.core.menu.TreeNode;
import com.collapsar.core.security.model.Authority;
import com.collapsar.snail.menu.form.SystemManageTreeMenu;

/**
 * <pre>
 * REVISIONS: 
 * Version 	Date 		Author 			Description
 * ------------------------------------------------------------------- 
 * 1.0 		2012-7-31 	BrianChen 	1. Created this class. 
 * </pre>
 * 
 * @author BrianChen
 * @date 2012-7-31 下午04:33:26
 * @version 1.0
 * @see
 * 
 */
@SuppressWarnings("serial")
public class QueryTreeMenuAction extends BaseStrutsAction{
	//private TreeNode sideMenu = null;
	
	@Override
	public String execute() throws Exception {
		String topMenuId = this.request.getParameter("topMenuId").toString();
		logger.info("###topMenuId="+topMenuId);
		this.request.getSession().setAttribute("topMenuId", topMenuId);
		TreeNode sideMenu = null;
		if("sys-home".equals(topMenuId)){
			this.request.getSession().setAttribute("sideMenu", null);
			return "index";
		}else if("sys-mng".equals(topMenuId)){
			sideMenu = SystemManageTreeMenu.init(new ArrayList<Authority>());
			this.request.getSession().setAttribute("sideMenu", sideMenu);
			//logger.info("###sideMenu="+sideMenu);
			return "index_sys_mng";
		}else{
			this.request.getSession().setAttribute("sideMenu", null);
			return "index";
		}
	}

//	public TreeNode getSideMenu() {
//		return sideMenu;
//	}
//
//	public void setSideMenu(TreeNode sideMenu) {
//		this.sideMenu = sideMenu;
//	}



	
	
}

